Move setting of configuration variables to Config.mk.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 5 Oct 2005 12:32:00 +0000 (13:32 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 5 Oct 2005 12:32:00 +0000 (13:32 +0100)
Allows for partial-tree builds to be invoked from a sub-directory.
Allow for users to include a ".config" with additional custom settings.

Signed-off-by: Michal Ostrowski <mostrows@watson.ibm.com>
Config.mk
Makefile
buildconfigs/Rules.mk
xen/Rules.mk

index e5f53cbc16055e8dbad040d6e6eca8bf14816f75..6f104e99e328f2a2b264c55aea1e298d911fa4af 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -20,6 +20,15 @@ STRIP      = $(CROSS_COMPILE)strip
 OBJCOPY    = $(CROSS_COMPILE)objcopy
 OBJDUMP    = $(CROSS_COMPILE)objdump
 
+# Default is to install to local 'dist' directory.
+DISTDIR ?= $(XEN_ROOT)/dist
+DESTDIR ?= $(DISTDIR)/install
+
+INSTALL      = install
+INSTALL_DIR  = $(INSTALL) -d -m0755
+INSTALL_DATA = $(INSTALL) -m0644
+INSTALL_PROG = $(INSTALL) -m0755
+
 ifeq ($(XEN_TARGET_ARCH),x86_64)
 LIBDIR = lib64
 else
@@ -49,3 +58,5 @@ ACM_USE_SECURITY_POLICY ?= ACM_NULL_POLICY
 XENSTAT_XENTOP ?= y
 
 VTPM_TOOLS ?= n
+
+-include $(XEN_ROOT)/.config
index e9e6b82019e952a2a1e4a964a830fd86d4ce4277..91ee5b043a35598e15f57e0f4c9d811a5899918e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,23 +2,12 @@
 # Grand Unified Makefile for Xen.
 #
 
-# Default is to install to local 'dist' directory.
-DISTDIR ?= $(CURDIR)/dist
-DESTDIR ?= $(DISTDIR)/install
-
-INSTALL                := install
-INSTALL_DIR    := $(INSTALL) -d -m0755
-INSTALL_DATA   := $(INSTALL) -m0644
-INSTALL_PROG   := $(INSTALL) -m0755
-
 KERNELS ?= linux-2.6-xen0 linux-2.6-xenU
 # linux-2.4-xen0 linux-2.4-xenU netbsd-2.0-xenU
 # You may use wildcards in the above e.g. KERNELS=*2.4*
 
 XKERNELS := $(foreach kernel, $(KERNELS), $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.$(kernel))) )
 
-export DESTDIR
-
 # Export target architecture overrides to Xen and Linux sub-trees.
 ifneq ($(XEN_TARGET_ARCH),)
 SUBARCH := $(subst x86_32,i386,$(XEN_TARGET_ARCH))
@@ -28,6 +17,7 @@ endif
 # Default target must appear before any include lines
 all: dist
 
+XEN_ROOT=$(CURDIR)
 include Config.mk
 include buildconfigs/Rules.mk
 
index 440a9f63d1a2f9938b85215e563b0dc7ab6d46f3..a75bd47b0c859e64ddaf9a915176d8fc61c0e7d8 100644 (file)
@@ -6,6 +6,8 @@ include Config.mk
 DISTDIR        ?= $(CURDIR)/dist
 DESTDIR        ?= $(DISTDIR)/install
 
+export DESTDIR
+
 ALLKERNELS = $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.*))
 ALLSPARSETREES = $(patsubst %-xen-sparse,%,$(wildcard *-xen-sparse))
 
index 4c3cb8db4ea7f35ca002e1fc18c6fe3687ef38ce..d57ca65e5129c4faef9c29b3b2607e49de7227ce 100644 (file)
@@ -10,7 +10,8 @@ trace       ?= n
 domu_debug  ?= n
 crash_debug ?= n
 
-include $(BASEDIR)/../Config.mk
+XEN_ROOT=$(BASEDIR)/..
+include $(XEN_ROOT)/Config.mk
 
 # Set ARCH/SUBARCH appropriately.
 override COMPILE_SUBARCH := $(XEN_COMPILE_ARCH)